<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 同名省略，方法省略冒号function， 中括号语法动态设置属性名
        let name = 'zhangzhang';
        let age = 20;
        let title = "title"
        let obj = {
            name,
            age,
            ickt() {
                console.log(111111);
            },
            [title.toUpperCase()]: '爱创课堂'
        }

        // is方法，全等判断0 -0 为false; NAN NAN 为 true
        console.log(Object.is(0,-0));
        console.log(Object.is(NaN,NaN)); 

        // assgin浅复制，只能复制值类型，引用类型只是改变指针, 同名属性后面的覆盖前面的
        let obj1 = {
            name: 'xuxu',
            like: 'eat'
        }

        let obj2 = {
            arr: ['pink'],
            ickt() {
                console.log(222222)
            }
        }
        obj2.arr.push('blue');

        // let result = Object.assgin(obj, obj1, obj2);
        let result = Object.assign(obj, obj1, obj2);
        console.log(result);
        console.log(obj);
        
    </script>
</body>
</html>